package com.example.chapter03.button;

import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.example.chapter03.R;
import com.example.chapter03.utils.TimeUtils;

public class ButtonLongClickActivity extends AppCompatActivity {
    private TextView tv_btn_result;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_button_long_click);
        Button btn_click_public = findViewById(R.id.btn_long_click);
        tv_btn_result = findViewById(R.id.tv_btn_result);
        btn_click_public.setOnLongClickListener(v -> {
            tv_btn_result.setText(TimeUtils.getNowTime());
            return true;
        });
    }
}